package com.jintoufs.domain.security;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;

import java.io.Serializable;

/**
 * @author fisher
 * @Description: @SuppressWarnings("serial")
 * 资源信息实体
 */
public class Resource implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer id;
    private String resourceName;//资源名
    private String resourceType;//资源类型('M'-菜单 'F'-模块,'B'-按钮);
    private Integer sort;//资源排序
    private String href;//资源链接
    private String icon;//资源图标
    private Integer parentId;//上级资源Code
    private String parentIds; //父编号列表
    private String permission; //权限字符串

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getResourceType() {
        return resourceType;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this);
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public String getParentIds() {
        return parentIds;
    }

    public void setParentIds(String parentIds) {
        this.parentIds = parentIds;
    }

    public String makeSelfAsParentIds() {
        return getParentIds() + getId() + "/";
    }
}
